package com.homer.gps.track.persist;

import com.j256.ormlite.field.DatabaseField;
import com.j256.ormlite.table.DatabaseTable;

@DatabaseTable(tableName = "stopshasplaces")
public class StopsHasPlacesModel {
	public final static String STOP_ID_FIELD_NAME = "stop_id";
	public final static String PLACE_ID_FIELD_NAME = "place_id";

	@DatabaseField(generatedId = true)
	private int id;

	// This is a foreign object which just stores the id from the User object in this table.
	@DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = STOP_ID_FIELD_NAME)
	private StopModel stop;

	// This is a foreign object which just stores the id from the Post object in this table.
	@DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = PLACE_ID_FIELD_NAME)
	private PlaceModel place;

	public StopsHasPlacesModel() {
		// all persisted classes must define a no-arg constructor with at least package visibility
	}

	public StopsHasPlacesModel(StopModel stop, PlaceModel place) {
		this.stop = stop;
		this.place = place;
	}
}
